<template>
    <iframe 
        :src="src" 
        style="" 
        width="100%" 
        height="100%" 
        id="iframe1" 
        padding="0" 
        frameborder="0"
        marginwidth="0" 
        marginheight="0"
    ></iframe>
</template>
  
<script lang="ts" setup>
    // ！！！注意本组件只允许放在需要监听滚动页面的最底部，因为我们是通过父元素的节点获得内部所有子元素的高度所以必须要放在父元素中的最底部
    import { ref, reactive, markRaw, onBeforeMount, onMounted, onBeforeUnmount, nextTick, computed, watch } from 'vue'
    import type { Ref, Raw } from 'vue'
    import { useRoute, useRouter } from 'vue-router'
    import { storeToRefs } from 'pinia'
    import { useStore } from '@/store'
    import { childEvaluateGetReportPdfApi } from '@/apis'

    // const props = withDefaults(defineProps<{
    //     list?: any[], 
    // }>(), {
    //     list: () => [],
    // })
    // const { src = '' } = defineProps<{
    //     src?: string, 
    // }>()
    const dialogObj = defineModel<any>('dialogObj', {
        required: false,
        default: {}
    })
    const src: Ref<string> = ref('')
    onMounted(async() => {
        // if (dialogObj.value?.dialogParams.id) {
            childEvaluateGetReportPdfApi({
                id: dialogObj.value?.dialogParams.id
            }).then((res: any) => {
                src.value = 'data:application/pdf;base64,' + res.data
            })
           
        // }
    })

</script>

<style lang="scss" scoped>
    
</style>